//#define MAX_COND 10
//#define NB_MAX_REGLE 100
#define OK 0


/**********************Global Variables, Structures , types and constants *******************/

/************vvvvvvvvvvv  find them in config.h  vvvvvvvvvvv***********************************/

// structure for a typical condition : if valMax>val>valMin then active
/*
typedef struct
{
char idCapteur[20];
double valMin;
double valMax;}
Condition;
*/
/* an actionner with its activating conditions, 
whether turning on or off is determined by onOff*/
/*
typedef struct
{
Condition tabCondition[MAX_COND];
char idActionneur[20];
int onOff ;//0 = off
double valeur;
int nbCondition;
}Regle;
*/
//variables for keeping rules in memory
/*
Regle TabRegle[NB_MAX_REGLE];
int nbRegle;
int idSemTabRegle;
*/

/************^^^^^^^^^    find them in config.h^^^^^^^^^    *******************************************/

//type de capteur
typedef enum{
T,//temperature
L,//luminorite
//TODO
}TypeCapteur;


//structure describing a sensor's type, status and value


typedef enum
{
	//TODO
	bon,
	alert
}etatCapteur;


#define MAX_NB_ACIONNEUR 50


MapCapteur TabCapteur[TAILLE_TAB_CAPTEUR];
//-----#define TAILLE_TAB_CAPTEUR 50


//incoming msg Q containing info update of TabCapteur
int msgQCapteurUpdate;






/***********************  Functions, methodes **********************/



int decide();
/*
	react to the new value of sensors
	a message will be dropped in msg queue "msgQReaction"
*/


int addRule(Regle *regle);
/*
	copy rule pointed by regle to table "TabRegle"

*/

int getCapteurTabIndex(char * capteurId);

int ModifyRule(Regle *regle, int index);

int getRuleIndex(const Regle *regle);

int DeleteRule(int index);


/*********************Trolls******************/





